export function getCurrTime(data) {
  // console.log(data)
  if (data) {
    // console.log(data)
    let dateBegin = new Date(data.replace(/-/g, "/"));
    let dateEnd = new Date(); //获取当前时间
    let dateDiff = dateEnd.getTime() - dateBegin.getTime(); //时间差的毫秒数
    let dayDiff = Math.floor(dateDiff / (24 * 3600 * 1000)); //计算出相差天数
    let leave1 = dateDiff % (24 * 3600 * 1000) //计算天数后剩余的毫秒数
    let hours = Math.floor(leave1 / (3600 * 1000)) //计算出小时数
    //计算相差分钟数
    let leave2 = leave1 % (3600 * 1000) //计算小时数后剩余的毫秒数
    let minutes = Math.floor(leave2 / (60 * 1000)) //计算相差分钟数
    //计算相差秒数
    let leave3 = leave2 % (60 * 1000) //计算分钟数后剩余的毫秒数
    let seconds = Math.round(leave3 / 1000);
    console.log(dayDiff, 'dayDiff')
    console.log(typeof(dayDiff), 'dayDiff')
    if (dayDiff == NaN) {
      return '暂无数据'
    } else {
      return dayDiff + "天 " + hours + "小时 " + minutes + "分 " + seconds + "秒 ";
    }
  } else {
    return '暂无数据'
  }
}
